const timeline = this.pageObj.getApiWidgetByAliasName('timeline-v2');
const timelineDetail = this.pageObj.getApiWidgetByAliasName('timeline-detail');

let option = timeline.widgetObj._option;
let subOpt = timelineDetail.widgetObj._option;
const row = { column: 6, container: "content", nowrap: true, type: "object" }

console.log($event, timeline, option)

option.mode = 'card';
option.bubble = { type: 'bubble-border' };
option.triangle = { direction: 'bottom', bottom: -25 };
option.config = [
  { ...row, field: "event", label: "关联事件" },
  { ...row, field: "name", label: "任务名称" },
  { ...row, field: "receiver", label: "任务接受方" },
  { ...row, field: "recordTime", label: "任务时间" },
  { ...row, field: "type", label: "任务类型" },
  { ...row, field: "address", label: "任务点位" },
  { ...row, field: "department", label: "任务下发部门" },
  { ...row, field: "sender", label: "任务下发人" },
  // { ...row, field: "content", label: "任务附件" },
  // { ...row, field: "content", label: "任务附件",  field: "files", type: "file" },
  { ...row, field: "state", label: "任务状态" },
];
option.dataSource = [
  {
    "event": "反恐防爆",
    "name": "开展应急处置工作",
    "receiver": "张国良",
    "recordTime": "2023-07-31 20:46 至 2023-07-31 22:30",
    "type": "应急处置",
    "address": "重铁东站广场",
    "department": "调度中心",
    "sender": "张思",
    "value": "这里是对应的值",
    "content": "这里是附件文档.docx",
    "state": "进行中",
    "files": [
      "https://img-blog.csdnimg.cn/5a26bb2e6eb74aa0ac42d44bef0f61c2.mp4",
      "https://img-blog.csdnimg.cn/5a26bb2e6eb74aa0ac42d44bef0f61c2.jpeg",
      "https://img-blog.csdnimg.cn/5a26bb2e6eb74aa0ac42d44bef0f61c2.text",
      "https://img-blog.csdnimg.cn/5a26bb2e6eb74aa0ac42d44bef0f61c2.docx",
      "https://img-blog.csdnimg.cn/5a26bb2e6eb74aa0ac42d44bef0f61c2.xps",
      "https://img-blog.csdnimg.cn/5a26bb2e6eb74aa0ac42d44bef0f61c2.xls"
    ]
  }
];


// 子列表
subOpt.mode = 'list';
subOpt.bubble = { type: 'bubble-border' };
subOpt.triangle = { direction: 'left', left: -25 };
subOpt.node = { index: true };
option.config = [
  // 气泡内部的 第一行
  { column: 12, container: "title",  field: "name", nowrap: true, type: "text" },

  // 气泡内部的 第二行
  { column: 12, container: "title",  field: "files", nowrap: true, type: "file" },

  // 气泡内部的 第三行 左边
  { column: 6, container: "content",  field: "value", nowrap: true, type: "text" },
  // 气泡内部的 第三行 右边
  { column: 6, container: "content",  field: "content", nowrap: true, type: "text" },
];


timeline.widgetObj._option = option
timeline.widgetObj.render()


timelineDetail.widgetObj._option = subOpt
timelineDetail.widgetObj.show({ top: 500, height: 300 });
timelineDetail.widgetObj.render()




